<link rel="stylesheet" href="http://www.12301.cc/css/common/www.12301.cc.global.css"/>
<script type="text/javascript" src="http://www.12301.cc/tpl/channels_confd/js/global.js"></script>
<link type="text/css" rel="stylesheet" href="http://www.12301.cc/tpl/new_tpl/ad_config_page/css/ad_config.css"/>
<script type="text/javascript" src="http://www.12301.cc/tpl/new_tpl/credit/js/page.js"></script>
<div class="ad_config">
	<div class="ad_set">
		<ul id="tabHead" class="tabHead clearfix">
			<li class="profit">分销价格配置</li>
		</ul>
		<input type="hidden" class="pid" value="<?=$_REQUEST['pid']?>">
		<input type="hidden" class="sid" value="<?php echo ($_REQUEST['sid']) ? $_REQUEST['sid']:0;?>">
		<div class="ad_price" qu="">
			<span class="ad_title"><?=$ltitle?></span>
			<span class="ad_order">(<?=$ttitle?>)</span>
			<span class="ad_price_">供货价：</span>
			<span class="ad_price_g"><?=$priSelf?></span>
			<span class="ad_price_k">元</span>
			<div class="ad_right">
				<span class="ad_right_title">
					结算价为空时</br>
					则不对其分销
				</span>
			
			</div>
		</div>
		<div class="ad_top">
			<div class="ad_top_left">
				<input class="formInp_a search" id="search_text"  value="分销商名称/账号" onfocus="if(this.value == '分销商名称/账号') this.value = ''" onblur="if(this.value =='') this.value = '分销商名称/账号'" type="text" >
				<i class="iconfont select_icon">&#xe608;</i>
				<span class="sure_btn">确定</span>
				<span class="del_btn">取消</span>
			</div>
			<div class="ad_top_right">
				<span class="js_title">结算价(元)</span>
				<a href="javascript:void(0)"   class="iconfont rude add_icon sub subBtn countBtn" cd="0" >&#xe60b;</a>
				<input class="formInp countInp" onkeyup="pri()" id="pri_d" js="<?=$priSelf?>"  type="text" value="<?=$priSelf?>" >
				<a href="javascript:void(0)"  class="iconfont add cut_icon plus countBtn plusBtn" cd="1">&#xe60a;</a>
			</div>
		</div>
		<div class="order_list">
		<form target="ifr" id="form" method="post">
			<input type="hidden" name="pid" value="<?=$_REQUEST['pid']?>">
			<input type="hidden" name="sid" value="<?php echo ($_REQUEST['sid']) ? $_REQUEST['sid']:0;?>">
			<table class="tb_scenic" id="mlistUl" border="0" cellpadding="0" cellspacing="0"></table>	
		</form>
		<div class="tcdPageCode"></div>
		<div class="page_num">
			每页
			<input type="text" class="page_num_ formI_" value="">
			条,
		</div>
		<div class="page_list">
			到
			<input type="text" class="page_num_b formI" value="">
			页
			<span class="page_sub">确定</span>
		</div>
			<!-- <div class="pagenavW clearfix" id="pagenavW">
				<div class="rt">
					<div class="d d2">
						<span id="total_num"></span>
						<span id="whichPage">第<span id="whichPageNum" style="margin:0 3px;"></span>页</span> 
						<a id="prevPageBtn" href="javascript:void(0)" data-first="" data-last=""  data-mid="" class="prevBtn btn pageBtn disable" style="margin-left:10px;">上一页</a>
						<a id="nextPageBtn" href="javascript:void(0)" class="nextBtn btn pageBtn">下一页</a>
					</div>
				</div>
			</div> -->
			<span class="save_btn" id="scope_btn" time="">保存配置</span>
		</div>
	</div>
</div>

<script type="text/javascript" src="http://wx.12301.cc/public/js/common/class.js"></script>
<script type="text/javascript" src="http://wx.12301.cc/public/js/common/ajax.js"></script>
<script language="javascript" src="http://www.12301.cc/tpl/new_tpl/ad_config_page/js/ad_config.js"></script>
<script language="javascript" src="http://www.12301.cc/tpl/new_tpl/ad_config_page/js/config.js"></script>
<script>
window.onload = function(){  
	var pa = Number($(".save_btn").attr("time"));
	var pid = $(".pid").val();
	var sid = $(".sid").val();
	var qQuery = new Query({container:$(".order_list")});
	$(".tcdPageCode").createPage({
			pageCount:pa,
			current:1,
			 backFn:function(p){
			   qQuery.query({
				 pid : pid,
				 sid : sid,
				 last:p
				});
			 }
	});
};
$(".page_sub").on("click",function(){
		var pid = $(".pid").val();
		var sid = $(".sid").val(); 
		var num_list = Number($(".page_num_").val());//每页显示
		var num_ = Number($(".page_num_b").val());  //跳页
		var num = num_ || "1";
		//console.log(num)
		var pa = Number($(".save_btn").attr("time"));
		console.log(pa)
		//if(!num || !PFT_GLOBAL.U.isPositiveNum(num)){
		//if(!PFT_GLOBAL.U.isPositiveNum(num)){
		//	PFT_GLOBAL.U.Alert("fail",'<p style="width:240px">抱歉跳页必须大于0的整数</p>');
		//	return false;
		//}else{
			if(num>pa){
				PFT_GLOBAL.U.Alert("fail",'<p style="width:240px">抱歉最多只有'+pa+'页</p>');
				return false;
			}else{
				var qQuery = new Query({container:$(".order_list")});
				qQuery.query({
					pid : pid,
					sid : sid,
					last:num,
					pageSize:num_list
				});
				$(".tcdPageCode").createPage({
					pageCount:num,
					current:1, 
					backFn:function(p){
						qQuery.query({
						 pid : pid,
						 sid : sid,
						 last:p,
						 pageSize:num_list
						});
					  
					 }
				});
				 
			}
		//}
	});
</script>